//WdgColors.cpp
/*    widgetpp - A simple C++ wrapper of DISLIN graphic library               */
/*                                                                            */
/*    Copyright (C) 2012  Mirko Cambi (email: mirko.cambi@gmail.com)          */
/*                                                                            */
/*    This program is free software: you can redistribute it and/or modify    */
/*    it under the terms of the GNU General Public License as published by    */
/*    the Free Software Foundation, either version 3 of the License, or       */
/*    (at your option) any later version.                                     */
/*                                                                            */
/*    This program is distributed in the hope that it will be useful,         */
/*    but WITHOUT ANY WARRANTY; without even the implied warranty of          */
/*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           */
/*    GNU General Public License for more details.                            */
/*                                                                            */
/*    You should have received a copy of the GNU General Public License       */
/*    along with this program.  If not, see <http://www.gnu.org/licenses/>.   */

#include "WdgColors.hpp"
#include <string>
#include "dislin.h"

const unsigned int
   wdgpp::colors::fore    = 0,
   wdgpp::colors::black   = 1, 
   wdgpp::colors::red     = 2, 
   wdgpp::colors::green   = 3,
   wdgpp::colors::blue    = 4,
   wdgpp::colors::cyan    = 5,
   wdgpp::colors::yellow  = 6,
   wdgpp::colors::orange  = 7,
   wdgpp::colors::magenta = 8,
   wdgpp::colors::white   = 9;

   
void wdgpp::set_color(unsigned int c)
{
   std::string sc;
   switch(c) {
      case 1:
         sc = "BLACK";
         break;
      case 2:
         sc = "RED";
         break;
      case 3:
         sc = "GREEN";
         break;
      case 4:
         sc = "BLUE";
         break;
      case 5:
         sc = "CYAN";
         break;
      case 6:
         sc = "YELLOW";
         break;
      case 7:
         sc = "ORANGE";
         break;
      case 8:
         sc = "MAGENTA";
         break;
      case 9:
         sc = "WHITE";
         break;
      default:
         sc = "FORE";    
   }
   
   color(sc.c_str());
}

int rgb_color(float r, float g, float b)
{
   return intrgb(r, g, b);
}

